/**
 * 订单相关API
 */

import {
	http,
	Method
} from "@/utils/request.js";


/**
 * 创建订单
 * @param params
 */
export function orderCreate(params) {
	return http.request({
		url: "/api/order/create",
		method: Method.POST,
		data: params,
	});
}

/**
 * 创建支付
 * @param params
 */
export function paymentCreate(params) {
	return http.request({
		url: "/api/order/createPayment",
		method: Method.POST,
		data: params,
	});
}


/**
 * 订单列表
 * @param params
 */
export function getOrderList(params) {
	return http.request({
		url: "/api/order/index",
		method: Method.GET,
		params,
	});
}

/**
 * 取消订单
 * @param params
 */
export function cancelOrder(params) {
	return http.request({
		url: "/api/goods/cancelOrder",
		method: Method.POST,
		data: params,
	});
}


/**
 * 订单详情
 * @param params
 */
export function getOrderDetail(params) {
	return http.request({
		url: "/api/order/detail",
		method: Method.GET,
		params,
	});
}

/**
 * 合同详情
 * @param params
 */
export function contractDetail(params) {
	return http.request({
		url: "/api/contract/detail",
		method: Method.GET,
		params,
	});
}

/**
 * 获取签署链接
 * @param params
 */
export function getSignUrl(params) {
	return http.request({
		url: "/api/contract/getSignUrl",
		method: Method.GET,
		params,
	});
}